<?php
header("Content-Type:text/json");
require_once 'dbConnect.php';

if(($id = $_GET['id']) == null) {
	echo "ERROR:为接受到数据";
}
$sql = "SELECT * FROM `city` WHERE `province_id`=:id ORDER BY `city_index`";
try{
	$stmt = $pdo->prepare($sql);
	$stmt->bindParam(':id', $id);
	$stmt->execute();
	
	$citys = $stmt->fetchAll(PDO::FETCH_ASSOC);
	echo json_encode($citys);
}
catch (PDOException $e) {
	echo $e->getMessage();
}